home *** CD-ROM | disk | FTP | other *** search
- Path: sierra.net!usenet
- From: "Tyler G. Colwell" <snowbull@sierra.net>
- Newsgroups: comp.lang.c++
- Subject: Strange (to me) notation - little help?
- Date: Wed, 03 Jan 1996 17:51:40 -0800
- Organization: Sierra-Net
- Message-ID: <30EB32AC.2836@sierra.net>
- NNTP-Posting-Host: 204.94.232.59
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b3 (WinNT; I)
-
- I am reading Jesse Liberty's "Teach Yourself C++ in 21 Days" and have come across some notation that I can't
- find explained anywhere. Here is a code fragment of a constructor that he uses in listing 9.4:
-
- ***********************************************
- class SimpleCat
- {
- public:
- SimpleCat (int age, int weight);
- ~SimpleCat() {}
- int GetAge() { return itsAge; }
- int GetWeight() { return itsWeight; }
- private:
- int itsAge;
- int itsWeight;
- };
-
- SimpleCat::SimpleCat(int age, int weight):
- itsAge(age), itsWeight(weight) {}
- ***********************************************
-
- Wow, those last two lines are dumbfounding. What is the colon at the end of that one line for, and what's up
- with using members itsAge and itsWeight as functions in the last line, and howcome none of them are inside the
- braces?
-
- Looking forward to some clarification on this one...
-
- Thanks,
-
- Tyler Colwell
-